<?php
require_once 'include/base.php';
require_once 'include/topwrap.php';
require_once 'include/global.func.php';
require_once 'inc/config.php';
require_once 'inc/classes/db.php';
$taoapi = new TopWrap(false,true);
$db = new db($gDb);


$brands = $db->fetchrows("select * from ".$gDb['prefix']."brands");
$___tmp = array();
$count = count($brands);
for($i=0;$i<$count;$i++)
{
	$___tmp[$brands[$i]['brandcate']][] = $brands[$i];
}
$catetext = array(1=>'流行服饰','美肤美妆','时尚配饰','运动户外','3C数码','家居家电','母婴用品');
$cates  = $taoapi->getItemCats();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="淘宝商品品牌大全" />
<meta name="description" content="淘宝商品品牌大全" />
<title>品牌大全_爱淘商城</title>
<link type="text/css" rel="stylesheet" href="static/search.css" />
<style>
.brand-wrap{ width:900px;}
.brand-wrap dd{ float:left; width:150px; text-align:center; margin:15px}
a{color:#333333; text-decoration:none;}
a:hover{color:#FF5500; text-decoration:underline;}
</style>
</head>

<body>
<?php include('blocks/nav.php'); ?>
<div id="item-container" style="line-height:25px;">
	<div class='search-nav'><a href="itemsearch.php">搜索首页</a> -> 品牌大全</div>
	
    <?php foreach( $___tmp as $key => $brands ): ?>
    	
        <dl class="brand-wrap" style="clear:both;">
        <dt style="width:100%; background:#CCC;"><?php echo $catetext[$key]; ?></dt>
        <?php foreach( $brands as $brand ):?>
        <dd>
            <a href="itemsearch.php?q=<?php echo $brand['searchkey'];?>"><img src="<?php echo $brand['imgpath'];?>" border=0 /></a>
            <br />
            <a href="itemsearch.php?q=<?php echo $brand['searchkey'];?>"><?php echo $brand['brandname'];?></a>
        </dd>
        <?php endforeach;?>
        <dd style="clear:both;"></dd>
        </dl>
        <?php endforeach; ?>
	
</div>
<?php include('blocks/footer.php'); ?>
</body>
</html>
